package com.Java.train.business.controller.member;

import com.Java.train.business.entity.DTO.StationDTO;
import com.Java.train.business.entity.Station;
import com.Java.train.business.req.StationQueryReq;
import com.Java.train.business.service.StationService;
import com.Java.train.common.response.CommonResp;
import com.Java.train.common.response.PageResp;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @author luomoxingchen
* @since 2024-09-21
*/
@RestController
@RequestMapping("/station")
public class StationController {

    @Autowired
    private StationService stationService;

    @GetMapping("/query-list")
    @ApiOperation("Station查询全部")
    public CommonResp<PageResp<StationDTO>> queryList(@Valid StationQueryReq stationQueryReq){
        PageResp<StationDTO> list = stationService.queryList(stationQueryReq);
        return new CommonResp<>(list);
    }

    @GetMapping("/query-all")
    @ApiOperation("Station查询全部")
    public CommonResp<List<StationDTO>> queryAll(){
        List<StationDTO> list = stationService.queryAll();
        return new CommonResp<>(list);
    }
}
